package com.gopay.common.domain.cbrmb.batchpay;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * 跨境人民币 批量支付信息表
 * @CbrmbBatchPayInfo.java
 * @author lailingyu
 * @2017-8-22 下午2:19:17  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name="CB_RMB_BATCH_PAY_INFO")
public class CbRmbBatchPayInfo implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -3162525873551294785L;

	/**
     * 记录流水号
     */
	private long sq;

	/**
	 * 批次任务ID
	 */
	private String batchId;

	/**
	 * 交易流水号
	 */
	private int transDtlSq;

	/**
	 * 国付宝订单号
	 */
	private String gopayOrderId;

	/**
	 * 交易金额
	 */
	private BigDecimal merTxnAmt;

	/**
	 * 创建时间
	 */
	private Date createdTime;

	/**
     * 乐观锁版本号
     */
    private int version;

	public CbRmbBatchPayInfo() {
	}

	@Id
	@SequenceGenerator(name="CB_RMB_BATCH_PAY_INFO_SQ_GENERATOR", sequenceName="CB_RMB_BATCH_PAY_INFO_SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CB_RMB_BATCH_PAY_INFO_SQ_GENERATOR")
	@Column(name = "SQ", unique = true, nullable = false)
	public long getSq() {
		return sq;
	}

	public void setSq(long sq) {
		this.sq = sq;
	}

	@Column(name = "BATCH_ID", nullable = false, length = 30)
	public String getBatchId() {
		return batchId;
	}

	public void setBatchId(String batchId) {
		this.batchId = batchId;
	}

	@Column(name = "TRANS_DTL_SQ", nullable = false, precision = 22, scale = 0)
	public int getTransDtlSq() {
		return transDtlSq;
	}

	public void setTransDtlSq(int transDtlSq) {
		this.transDtlSq = transDtlSq;
	}

	@Column(name = "GOPAY_ORDER_ID", length = 30)
	public String getGopayOrderId() {
		return gopayOrderId;
	}

	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	@Column(name = "MER_TXN_AMT", precision = 20)
	public BigDecimal getMerTxnAmt() {
		return merTxnAmt;
	}

	public void setMerTxnAmt(BigDecimal merTxnAmt) {
		this.merTxnAmt = merTxnAmt;
	}

	@Column(name = "CREATED_TIME", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	@Version
	@Column(name="VERSION", nullable = false, precision = 22, scale = 0)
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
}
